package data;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.util.ArrayList;
import graph.GraphPanel;
@SuppressWarnings("serial")
public class Dimensions extends ArrayList<String> {
	public GraphPanel graphingData;
	public Dimensions() {
		super();
	}
	public Dimensions(ArrayList<String> choices) {
		super();
    	for(String str: choices) {
    		add(str);
    	}
	}

	
	public int getMaxWidth(Graphics g) {
		FontMetrics fm = g.getFontMetrics();
		int width = 0;
		int maxWidth = 0;
    	for (int i = 0; i < size(); i++) {
    		width = fm.stringWidth(	(java.lang.String) get(i));
    		maxWidth = width > maxWidth ? width : maxWidth;
    	}
    	return maxWidth;
	}
}
